<template>
	<u-sticky h5-nav-height="0">
		<view class="u-p-l-28 u-p-r-28 bgw">
			<view class="u-flex search-box">
				<location-nav></location-nav>
				<view class="u-flex-1">
					<u-search v-model="searchParams.storesName" bg-color="#ffffff" :show-action="false"
						placeholder="请输入店铺名称搜索" @search="getList(1)" @clear="getList(1)"></u-search>
				</view>
			</view>
		</view>
	</u-sticky>

	<!-- <u-gap height="20"></u-gap> -->
	<!-- <view class="u-p-28">
		当前自提店铺
	</view>
	<view class="u-p-l-20 u-p-r-20">
		<view class="box-radius bgw u-p-28 u-flex">
			<view class="item-img-wrap">
				<image class="" src="https://imgzh.kmmyxb.cn/fcjy/2024/11/18/pic_20241107193206_16198%20(1).jpg"
					mode="aspectFill"></image>
			</view>
			<view class="u-flex-1">
				<view class="u-font-28">
					自提店铺名称(新迎新城店)
				</view>
				<u-gap height="20"></u-gap>
				<view class="u-font-24 u-content-color">
					昆明市盘龙区新兴路262号附18号
				</view>
			</view>
		</view>
	</view> -->
	<view class="u-p-28">
		自提店铺
	</view>
	<template v-for="(item, index) in list" :key="item.sid">
		<view class="u-p-l-20 u-p-r-20" @click="chooseShop(item)">
			<view class="box-radius bgw u-p-28 u-flex">
				<view class="item-img-wrap">
					<image class="" :src="baseImgUrl+item.storesImg" mode="aspectFill"></image>
				</view>
				<view class="u-flex-1">
					<view class="u-font-28">
						{{item.storesName}}
					</view>
					<u-gap height="10"></u-gap>
					<view class="u-font-24 u-content-color">
						{{item.province}} {{item.city}} {{item.district}} {{item.address}}
					</view>
					<u-gap height="10"></u-gap>
					<view class="u-content-color u-font-24">
						<text>联系方式：{{item.name}}-{{item.phone}}</text>
					</view>
				</view>
			</view>
		</view>
		<u-gap height="20"></u-gap>
	</template>


	<g-loadmore :status="loadmoreStatus"></g-loadmore>
</template>
<script setup>
	import store from '@/store/index.js';
	import mixins from '@/common/js/mixins.js';
	import mixinList from '@/common/js/mixinList.js';
	import {
		ref,
		reactive,
		computed,
		watch,
		getCurrentInstance
	} from 'vue'
	import {
		onReady,
		onLoad,
		onShow,
		onPageScroll
	} from '@dcloudio/uni-app'
	const {
		proxy,
	} = getCurrentInstance()
	const {
		nav,
		navLogin
	} = proxy.$util;
	const {
		total,
		current_page,
		page_size,
		last_page,
		apiPath,
		loading,
		list,
		searchParams,
		getList,
		getNextList,
		loadmoreStatus,
		searchClear,
		searchConfirm
	} = mixinList();
	apiPath.value = 'getPickupAddress'
	const location = computed(() => store.state.$location)
	// searchParams.province_code = computed(() => {
	// 	return location.value.province_code
	// })
	// searchParams.city_code = computed(() => {
	// 	return location.value.city_code
	// })
	// searchParams.province = computed(() => {
	// 	return location.value.province_name
	// })
	// searchParams.city = computed(() => {
	// 	return location.value.city_name
	// })
	watch(() => location.value,
		newValue => {
			getList(1)
		}
	);
	searchParams.storesName = '';
	const chooseShop = (v) =>{
		uni.$emit('choose_shop', v)
		uni.navigateBack();
	}
	onReady(() => {

	})
	onLoad(async (d) => {
		await getList(1)
	})
	onShow(() => {

	})
	onPageScroll(e => {

	})
</script>
<style>

</style>
<style lang="scss" scoped>
	.fixed-bottom {
		background-color: #ffffff;
		box-shadow: 0 -4upx 20upx 0 rgba(0, 0, 0, 0.06);
		bottom: 0;
		z-index: 999;
	}

	.item-img-wrap {
		width: 120upx;
		height: 120upx;
		min-width: 120upx;
		border-radius: 10upx;
		overflow: hidden;
		margin-right: 20upx;

		image {
			width: 120upx;
			height: 120upx;
		}
	}
</style>